﻿
using System;
using Microsoft.Practices.Unity;

namespace Microsoft.Practices.ServiceLocation
{
    public static class ServiceLocator 
    {
        private static IServiceLocator _current;
        public static IServiceLocator Current
        {
            get { return _current; }
        }

        public static IServiceLocator SetLocatorProvider(ServiceLocatorProvider newProvider)
        {
            if (newProvider == null)
                _current = null;
            else
            {
                _current = newProvider();

            }
            return Current;
        }

    }
}
